/**
 * $Revision: 1.0 $
 * $Author: Eric Yang $
 * $Date: Aug 13, 2009 12:49:26 AM $
 *
 * Author: Eric Yang
 * Date  : Aug 13, 2009 12:49:26 AM
 *
 */
package com.gooex.web.action.organization.role;

import java.util.ArrayList;
import java.util.List;

import com.gooex.domain.organization.Group;
import com.gooex.domain.organization.Role;
import com.gooex.web.action.BaseProtectedAction;


/**
 * @author Eric Yang
 * @version 1.0
 */
public class ListRole extends BaseProtectedAction {
	public List<Role> getRoles() {
		Group group = sessionContext.getUser().getRole().getGroup();
		if (isSystemObject(group))
			return roleManager.getRoles();
		else if (group.isGrantor())
			return group.getRoles();
		else
			return new ArrayList<Role>();
	}
}
